﻿<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title</title>
        <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
        <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery-ui-1.8.16.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/AjaxLogin.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/wl.js?v5.0")" type="text/javascript"></script>
        <meta name="viewport" content="width=device-width">
        @Html.Raw(ViewData["header"])
        @Html.Raw(ESN.Helpers.DynamicPartial.GetOnlineInfoScript())
        <script type="text/javascript">
            $(document).ready(function () {
                var currentMessageShow = 1;
                $("#appMess1").hide();
                $("#appMess2").hide();
                $('#userLogged').hide();
                $('#userNotLogged').hide();
                function ToggleMess() {
                    $("#slogan").effect("pulsate");

                    $("#appMess1").hide();
                    $("#appMess2").hide();
                    $("#appMess3").hide();

                    $("#appMess" + currentMessageShow.toString()).show("slide", "slow");
                    if (currentMessageShow == 3)
                        currentMessageShow = 1;
                    else
                        currentMessageShow++;
                }
                ToggleMess();
                window.setInterval(function () {
                    ToggleMess();
                }, 10000);
                if (typeof YourId != 'undefined') {
                    $('#userLogged').show();
                    $('#userLink').text(YourDisplayName);
                    $('#userLink').prop("href", "/" + YourUserName + "/Home");
                    UpdateNotices();
                    $(document).ready(function () {
                        $("#userInfoArea").prepend('<div><a href="/' + YourUserName + '/Settings">@ESN.Languages.LangString.Load("your_settings", "Home")</a></div>');
                        $("#userInfoArea").prepend('<div><a href="/' + YourUserName + '/Groups">@ESN.Languages.LangString.Load("your_group", "Home")</a></div>');
                        $("#userInfoArea").prepend('<div><a href="/' + YourUserName + '/Home">@ESN.Languages.LangString.Load("your_home", "Home")</a></div>');
                        $("#userInfoArea").prepend('<img width="190" src="' + YourAvatar + '" />');
                    });
                    $.getJSON("/CoreService.svc/GetFriendRequest", function (result) {
                        if (result.d.length > 0)
                            $("#userInfoArea").append('<div><a href="/' + YourUserName + '/Requests">@ESN.Languages.LangString.Load("you_have", "Home") ' + result.d.length + ' Friend Request.</a></div>');
                        else
                            $("#userInfoArea").append('<div><a href="/' + YourUserName + '/Requests">@ESN.Languages.LangString.Load("you_have", "Home") 0 Friend Request.</a></div>');
                    });
                    window.setInterval(function () {
                        UpdateNotices();
                    }, 5000);
                } else {
                    $('#userNotLogged').show();
                }
                function UpdateNotices() {
                    if(typeof YourId != 'undefined'){
                        $.getJSON("/CoreService.svc/CountUserNotice", function (result) {
                            if (result.d.CountUserNotice > 0)
                                $("#userInfoAreaNotices").html('<a href="/' + YourUserName + '/Notices">@ESN.Languages.LangString.Load("you_have", "Home") ' + result.d.CountUserNotice + ' new notices.</a>');
                            else
                                $("#userInfoAreaNotices").html('<a href="/' + YourUserName + '/Notices">@ESN.Languages.LangString.Load("you_have", "Home") 0 new notice.</a>');
                        });
                    }
                }
            });
        </script>
    </head>
    <body>
        <header>
            <div class="content-wrapper">
            <div class="float-left">
                <p class="site-title">@System.Configuration.ConfigurationManager.AppSettings["AppName"]</p> <h2 id="slogan">@System.Configuration.ConfigurationManager.AppSettings["AppSlogan"]</h2>
            </div>
            <div class="float-right">
                <table>
                    <tr>
                        <td>@Html.Raw(ESN.Helpers.DynamicPartial.GetNotification())</td>
                        <td><img height="107" src="@System.Configuration.ConfigurationManager.AppSettings["AppLogo"]" alt="logo" /></td>
                    </tr>
                </table>
            </div>
            </div>
        </header>
        <div id="body">
            <section class="content-wrapper clear-fix" style="background-color:#9FD9E0">
                <div id="mainContentRight" class="main-content" style="float: right; width : 77%; word-wrap: break-word; border-left : 1px dashed;">
                    @Html.Partial("Share")
                    @RenderBody()
                </div>
                <div id="menuLeft" class="ui-corner-all" style="float: left; width:20%; word-wrap: break-word;padding-top:10px;">
                    <section id="login">
                        <div id="userLogged" style="margin-top:4px;">
                            Hello, <a id="userLink"></a><br />
                            @Html.ActionLink("Log Off", "LogOff", "Account")
                        </div>
                        <div id="userNotLogged">
                            @Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", data_dialog_title = "Registration" })
                            @Html.ActionLink("Log on", "LogOn", "Account", routeValues: null, htmlAttributes: new { id = "logonLink", data_dialog_title = "Identification" })
                        </div>
                    </section>
                    <div id="userInfoArea" class="ui-corner-all ui-widget-content">
                        <div id="userInfoAreaNotices"></div>
                    </div>

                    <div class="ui-corner-all ui-widget-content">
                        @Html.Raw(ESN.Helpers.DynamicPartial.GetMenu())
                    </div>
                </div>
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - ESN</p>
                </div>
                <div class="float-right">
                <a href="http://test.thi.vn:1636/Lang/index?lang=vi">Vi</a>|<a href="http://test.thi.vn:1636/Lang/index?lang=en">En</a>
                </div>
            </div>
        </footer>
    </body>
</html>
